Diaconescu's theorem